@import (reference) "./common.less";

@keyframes tab-icon-appear {
    0% {
        transform: scale(0.5);
    }
    50% {
        transform: scale(1.25);
    }
    100%
    {
        transform: scale(1);
    }
}

.tab-icon-appear-animation {
    animation-name: tab-icon-appear;
    animation-duration: 0.5s;
    animation-function: ease-in;
    animation-fill-mode: forwards;
    opacity: 1;
}

.tabs {
    display: flex;
    flex-direction: row;
    align-items: flex-end;

    width: 100%;
    max-height: 48px;
    min-height: 32px;
    color: #c8c8c8;
    background-color: rgba(0, 0, 0, 0.2);
    overflow-x: auto;
}

.tab {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    height: 32px;
    flex: 0 0 auto;

    max-width: 350px;
    background-color: rgb(40, 44, 52);
    opacity: 0.6;
    transition: opacity 0.25s;

    overflow: hidden;
    text-overflow: ellipsis;

    .name {
        flex: 1 1 auto;
        text-align: center;
        height: 100%;

        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0px 4px;

        .name-inner {
            padding-top: 2px;
        }
    }

    .icon-container {
        position: absolute;
        top: 0px;
        left: 0px;
        right: 0px;
        bottom: 0px;

        display: flex;
        justify-content: center;
        align-items: center;

        transition: opacity 0.25s ease-out;
    }

    .x-icon-container {
        opacity: 0;
    }

    .circle-icon-container {
        opacity: 0;
    }

    &.is-dirty {
        .circle-icon-container {
            .tab-icon-appear-animation;
        }
    }

    &.not-dirty:hover {
        .corner {
            .x-icon-container {
                .tab-icon-appear-animation;
            }
        }
    }

    .corner {
        flex: 0 0 auto;
        width: 32px;
        height: 100%;

        display: flex;
        align-items: center;
        justify-content: center;

        position: relative;

        .circle {
            width: 8px;
            height: 8px;
            border-radius: 4px;
            background-color: #c8c8c8;
        }
    }

    .corner.enable-hover {
        &:hover {
            background-color: rgba(100, 100, 100, 0.1);
        }
    }

    &.not-selected {
        .box-shadow-up-inset();

        &:hover {
            opacity: 0.9;
        }
    }

    &.selected {
        .box-shadow-up();
        opacity: 1.0;
    }
}

